import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    name: 'layout',
    redirect: '/home',
    component:  () => import('@/Layout/index.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        component:  () => import('@/views/home/index.vue'),
        meta: {
            title: '工作台',
        }
      },
      {
            name: 'monitor',
            path: '/monitor',
            component:  () => import('@/views/monitor/rel.vue'),
            meta: {
                title: '实时监控'
            },
        },
        {
            // 云台
            name: 'cloudPlatform',
            path: '/monitor/cloudPlatform',
            component:  () => import('@/views/monitor/cloudPlatform.vue'),
            meta: {
                title: '云台'
            }
        },
        // 飞行监控
        {
            name: 'flightMonitor',
            path: '/monitor/fly',
            component:  () => import('@/views/monitor/fly2.vue'),
            meta: {
                title: '飞行监控'
            }
        },
      {
       name: 'uavProject',
       path: '/uavProject',
       redirect: '/uavProject/list',
       component:  () => import('@/views/project/uavProject/index.vue'),
        meta: {
            title: '无人机管理'
        },
        children: [
            {
                name: 'uavProjectList',
                path: '/uavProject/list',
                meta: {
                    title: '无人机项目列表'
                },
                component:  () => import('@/views/project/uavProject/list.vue'),
                },
              {
                name: 'uavProjectDetail',
                path: '/uavProject/detail',
                meta: {
                    title: '无人机项目信息页'
                },
                component:  () => import('@/views/project/uavProject/detail.vue'),
              },
       ]
      },
      {
        name: 'airportProject',
        path: '/airportProject',
        redirect: '/airportProject/list',
        component:  () => import('@/views/project/airportProject/index.vue'),
        meta: {
            title: '机场管理'
        },
        children: [
            {
                name: 'airportProjectList',
                path: '/airportProject/list',
                meta: {
                    title: '机场项目列表'
                },
                component:  () => import('@/views/project/airportProject/list.vue'),
            },

            {
                name: 'airportProjectDetail',
                path: '/airportProject/detail',
                meta: {
                    title: '机场项目信息页'
                },
                component:  () => import('@/views/project/airportProject/detail.vue'),
            },

            {
                name: 'airportProjectLine',
                path: '/airportProject/line',
                meta: {
                    title: '航线'
                },
                component:  () => import('@/views/project/airportProject/line.vue'),
            }
        ]
      },
        // 工单管理
        {
            name: 'workOrder',
            path: '/workOrder',
            component:  () => import('@/views/workOrder/index.vue'),
            meta: {
                title: '工单管理'
            }
        },

        // 飞行记录
        {
            name: 'flightRecord',
            path: '/flyRecord',
            component:  () => import('@/views/flyRecord/index.vue'),
            meta: {
                title: '飞行记录'
            }
        },
        // 算法识别
        {
            name: 'algorithm',
            path: '/algorithm',
            component:  () => import('@/views/algorithm/index.vue'),
            meta: {
                title: '算法识别'
            }
        },
        // 三维建模
        {
            name: 'threeDimensional',
            path: '/threeDimensional',
            component:  () => import('@/views/threeDimensional/index.vue'),
            meta: {
                title: '三维建模'
            }
        },
        // 使用文档
        {
            name: 'document',
            path: '/document',
            component:  () => import('@/views/document/index.vue'),
            meta: {
                title: '使用文档'
            }
        }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component:  () => import('@/views/login/index.vue'),
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
